<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html:form action="/View/searchflightlist.do" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<script type="text/javascript">


function yes(id){

var form = document.forms[0];

document.getElement

form.action ='../View/searchflightlist.do?id=' +id ;
form.submit();
	
}

</script>
</head>
<body>

	<jsp:include page="topmenu.jsp"></jsp:include>
	<br>
	<br><br>
	<center>
	<table><tr>
	
	Source : <html:select property="flight.source"
				name="searchFlightListForm">
				<html:optionsCollection name="searchFlightListForm"
					property="sourceList" label="label" value="value" />
			</html:select>&nbsp;&nbsp;&nbsp;&nbsp;
			
			Destination :<html:select property="flight.destination"
				name="searchFlightListForm">
				<html:optionsCollection name="searchFlightListForm"
					property="destList" label="label" value="value" />
			</html:select>&nbsp;&nbsp;&nbsp;&nbsp;
			
			Airline Name :<html:select property="flight.airlineName"
				name="searchFlightListForm">
				<html:optionsCollection name="searchFlightListForm"
					property="airlinenameList" label="label" value="value" />
			</html:select>
			
			<html:submit>Find Flights</html:submit>
		
	
	</tr>
	
	</table>
	
	<br>
	<br>
	
	<h4 style="color: red"><html:errors />
	<bean:write name="searchFlightListForm" property="error" /></h4>
	
	<br>
	
	<input type="radio" name="pay" value="Credit" title="Credit" checked="checked"/>Credit
	<input type="radio" name="pay" value="Debit" title="Debit"/> Debit
	<table border="1">
	
	<nested:iterate name="searchFlightListForm" property="flightList"  scope="session" indexId="id">
	
			
			
			
			<tr>
			
			
			<td>
			<bean:write name="flightList" property="airline"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td>
			<nested:write name="flightList" property="firstFlightNumber"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td>
			<nested:write name="flightList" property="boardingPoint"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			
			<td>
			<nested:write name="flightList" property="firstFlightStart"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			
			<nested:equal name="flightList"  property="secondFlightNumber" value="0">
			<td><nested:write name="flightList" property="destination"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			</nested:equal>
			
			<nested:notEqual name="flightList"  property="secondFlightNumber" value="0">
			<td><nested:write name="flightList" property="intermediatePoint"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			</nested:notEqual>
			
			<td><nested:write name="flightList" property="firstFlightEnd"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			
			<nested:notEqual name="flightList"  property="secondFlightNumber" value="0">
			<td><nested:write name="flightList" property="secondFlightNumber"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td>
			<nested:write name="flightList" property="intermediatePoint"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td><nested:write name="flightList" property="secondFlightStart"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td>
			<nested:write name="flightList" property="destination"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td><nested:write name="flightList" property="secondFlightEnd"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			</nested:notEqual>
			<td><nested:write name="flightList" property="totalPrice"/>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			
			
			<td>
		
		
			<input type="button" onclick='yes(<bean:write name="id"/>);' value="Reserve" >
			</td>
			</tr>
			
			
			
	</nested:iterate>		
			</table>
			
			
	</center>
	
	
</body>
</html:form>